<template>
	<view class="cmd-result-page">
		<image class="cmd-result-page-image" src="/static/zxqy.png" mode="aspectFit" style="width: 80px;"></image>
		<view v-if="formData.resultStatus" class="cmd-result-page-text" style="color: green;">{{typeText}}</view>
		<view v-else class="cmd-result-page-text" style="color: red;">{{typeText}}</view>
		<view class="cmd-result-page-subtext">{{typeSubText}}</view>
		<view class="cmd-result-page-buttons">
			<button @tap="reloadSign" class="button" type="default" plain="true" size="mini">重新签约</button>
			<button @tap="backIndex" class="button" type="primary" plain="true" size="mini">返回首页</button>
		</view>
	</view>
</template>

<script>
	export default {
		name: 'result-page',
		data() {
			return {
				typeText: "",//文案
				typeSubText: "",//副文案
				formData: {
					memberId: '',
					phone: '',
					companyId: '',
					//companyName: '',
					//companyCode: '',
					businessId: '',
					//businessName: '',
					tenantId: '',
					//signingService: '',
					signingServiceId: '',
					//releaseDate: '',
					//signContent: '',
					name: '',
					idCard: '',
					bankCardAccount: '',
					idCardZm: '',//身份证正面
					idCardFm: '',//身份证反面
					signImg: '', //签名图片
					signingFile: '',//签约文件
					resultStatus: false,//签约状态
					resultMessage: '',//签约错误消息
				},
			}
		},
		computed: {
			
		},
		onLoad(e) {
			if(!e.memberInfo){
				uni.showToast({title: "数据错误！",icon: "none",mask: true,});
				return;
			}
			this.formData = JSON.parse(decodeURIComponent(e.memberInfo));
			if(this.formData.resultStatus){
				this.typeText = '签约成功！';
				this.typeSubText = '您的签约信息可在我的签约中查看';
			}else{
				this.typeText = '签约失败！';
				this.typeSubText = this.formData.resultMessage;
			}
		},
		methods:{
			reloadSign(e){
				uni.reLaunch({
					url: '/signingPages/writeSignature?memberInfo=' + encodeURIComponent(JSON.stringify(this.formData))
				});
			},
			backIndex(e){
				uni.reLaunch({
					url: '/pages/index'
				});
			}
		}
	}
</script>

<style>
	.cmd-result-page {
		display: flex;
		align-items: center;
		justify-content: center;
		flex-direction: column;
		width: 100%;
		height: 100%;
		text-align: center;
		padding: 40upx 0;
	}

	.cmd-result-page-image {
		width: 220upx;
		height: 220upx;
		margin-bottom: 30upx;
		margin-top: 150upx;
	}

	.cmd-result-page-text {
		color: #111a34;
		font-size: 36upx;
		font-weight: bold;
	}

	.cmd-result-page-subtext {
		margin-top: 18upx;
		color: #858b9c;
		font-size: 28upx;
	}

	.cmd-result-page-buttons {
		display: flex;
		flex-direction: row;
		margin-top: 10px;	
	}
	.cmd-result-page-buttons .button {
		margin: 50upx;
		width: 120px;
	}
</style>
